const express = require('express');
const router = express.Router();
const categoryController = require('../controllers/categoryController');

// 获取所有分类
router.get('/categories', categoryController.getAllCategories);

// 获取单个分类
router.get('/categories/:id', categoryController.getCategoryById);

// 创建分类
router.post('/categories', categoryController.createCategory);

// 更新分类
router.put('/categories/:id', categoryController.updateCategory);

// 删除分类
router.delete('/categories/:id', categoryController.deleteCategory);

module.exports = router;